import React, { Component } from 'react'
import List from '../../components/List'
import axios from 'axios'

export class homepage extends Component {
    constructor(props) {
        super(props)
      
        this.state = {
           list:[],
        }
      }
      componentDidMount(){
          axios.get('/list').then((res)=>{
              this.setState({
                  list:res.data
              })
          })
      }
  render() {
      const {list}=this.state
    return (
      <div>
          <List list={list}></List>
      </div>
    )
  }
}

export default homepage